﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Comm;

public partial class Web_Admin_Admin_change_password : AdminPageBase
{
    private BLL.Admin bll = new BLL.Admin();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            loadData();
        }
    }

    /// <summary>
    /// 加载数据
    /// </summary>
    private void loadData()
    {
        lit_UserName.Text = base.myuser.Username;
    }

    /// <summary>
    /// 修改密码
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void but_save_Click(object sender, EventArgs e)
    {
        string password = txt_Password.Text.Trim();
        Model.Admin model = new Model.Admin();
        model.Password = password;
        if (bll.Update(model, "ID=" + base.myuser.ID) < 1)
        {
            MessageBox.Show("修改失败");
        }
        else
        {
            base.AddLog(2, "修改密码管理员ID：" + base.myuser.ID);
            MessageBox.Show("修改成功");
        }
    }
}
